package com.heima.gouzaofangfa;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ClassLocal02 {
    public static void main(String[] args) throws IOException {
        //类加载器的方法，加载某资源文件
        //获得系统加载器
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        //利用加载器加载一个指定文件
        //参数：文件的路径
        //返回值：字节流
        InputStream resourceAsStream = systemClassLoader.getResourceAsStream("prop.properties");
        Properties properties=new Properties();
        properties.load(resourceAsStream);
        System.out.println(properties);
        resourceAsStream.close();


    }
}
